<template>
  <div>
    <div class="app-container">
      <div>登录</div>

      <mt-field
        v-model="form.username"
        label="用户名"
        placeholder="请输入用户名"
      />
      <mt-field
        v-model="form.password"
        label="密码"
        placeholder="请输入密码"
        type="password"
      />

      <mt-button
        align="center"
        class="el-icon-plus"
        @click.native="handleLogin"
      >
        登录
      </mt-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'AppLogin',
  components: {},
  directives: {},
  filters: {},
  props: {
    title: { type: String, default: '我的' }
  },

  data() {
    return {
      // currentRow: {}

      form: {
        username: 'user1',
        password: '123456'
      }
    }
  },
  computed: {
    partner: function() {
      return this.$store.state.appMe.partner
    }
  },
  async created() {
    console.log('ssss,ss login app')
  },

  methods: {
    async handleLogin() {
      console.log('xxx,handleLogin')
      await this.$store.dispatch('user/login', this.form)
      const ss = this.$store.state.user
      console.log('ssss,ss', ss)
      this.$router.push({
        path: '/app'
        // query: this.otherQuery
      })
    }
  }
}
</script>

<style type="text/css">
.main {
  overflow: auto;
}
</style>
